<?php $_helper = Mage::helper('catsidebarnav'); ?>
<?php $showtype = $_helper->getShowType();?>
<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>
<?php if($_helper->isEnabled()): ?>
	<?php if($showtype == 'static'):?>
		<link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/magebuzz/catsidebarnav/static.css');?>" media="all" />
		<?php if($_menu): ?>
		<div class="block block-category-nav">
			<div class="block-title">
				<strong><span><?php echo $this->__('Categories') ?></span></strong>
			</div>
			<div class="block-content">
				<ul id="sidenav">
					<?php echo $_menu ?>
				</ul>
			</div>	
		</div>
		<?php endif ?>
	<?php elseif ($showtype == 'click-2-click'):?>
		<link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/magebuzz/catsidebarnav/click.css');?>" media="all" />
		<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"></script>
		<script type="text/javascript">
			var $j = jQuery.noConflict(); 
			$j(document).ready(function () {
			  $j('#sidenav > li > a.show-cat').click(function(){
				$j('#sidenav li ul').slideUp();
				if (!$j(this).hasClass('active')){				  
				  $j(this).next().slideToggle();
				  $j('#sidenav li a.show-cat').removeClass('active');
				  $j(this).addClass('active');
				}
				else if ($j(this).hasClass('active')) {
					$j(this).removeClass('active');
				}
			  });
			  $j('#sidenav > li > ul > li > a.show-cat').click(function(){
				$j('#sidenav li ul li ul').slideUp();
				if (!$j(this).hasClass('active')){
				  $j(this).next().slideToggle();
				  $j('#sidenav li ul li a.show-cat').removeClass('active');
				  $j(this).addClass('active');
				}
				else if ($j(this).hasClass('active')) {
					$j(this).removeClass('active');
				}
			  });
			});
		</script>
		<?php if($_menu): ?>
		<div class="block block-category-nav">
			<div class="block-title">
				<strong><span><?php echo $this->__('Categories') ?></span></strong>
			</div>
			<div class="block-content">
				<ul id="sidenav">
					<?php echo $_menu ?>
				</ul>
			</div>	
		</div>
		<?php endif ?>
	<?php elseif ($showtype == 'fly-out'):?>
		<link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/magebuzz/catsidebarnav/fly-out.css')?>" media="screen">
		<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/magebuzz/catsidebarnav/jquery-1.2.6.min.js')?>"></script>
		<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/magebuzz/catsidebarnav/hoverIntent.js')?>"></script>
		<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/magebuzz/catsidebarnav/superfish.js')?>"></script>
		<script type="text/javascript">
			jQuery.noConflict();
			jQuery(function(){
						jQuery('ul.sf-menu').superfish();
					});
		</script>
		<?php if($_menu): ?>
		<div class="block block-category-nav">
			<div class="block-title">
				<strong><span><?php echo $this->__('Categories') ?></span></strong>
			</div>
			<div class="block-content">
				<ul class="sf-menu" id="left-nav">					
					<?php echo $_menu ?>
				</ul>
			</div>	
		</div>
		<?php endif ?>
	<?php endif ?>	
<?php endif ?>	